package com.zy.ivideo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;
import sun.dc.pr.PRError;

import javax.persistence.*;
import java.util.Date;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Data
@ApiModel(value = "短视频实体类",description = "短视频实体类")
@Table(name = "b_simple_video")
public class SimpleVideoEntity {

    @ApiModelProperty(value = "主键id",position = 16,example = "0")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 关联videotype表 类别
     */
    @ApiModelProperty(value = "关联videotype表 类别",position = 16,example = "0")
    @Column(name = "channelid",length = 100)
    private String channelid;

    /**
     * 分组id
     */
    @ApiModelProperty(value = "分组id",position = 16,example = "0")
    @Column(name = "group_id",length = 100)
    private String group_id;

    /**
     * 数据id
     */
    @ApiModelProperty(value = "数据id",position = 16,example = "6992028792893997581")
    @Column(name = "item_id",length = 100)
    private String item_id;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题",position = 16,example = "视频标题1")
    @Column(name = "title")
    private String title;

    /**
     * 图片地址
     */
    @ApiModelProperty(value = "图片地址",position = 16,example = "http://xx.com/a.png")
    @Column(name = "image_url")
    private String image_url;

    /**
     * 播放数量
     */
    @ApiModelProperty(value = "播放数量",position = 16,example = "100")
    @Column(name = "playnum",columnDefinition = "int DEFAULT 0 COMMENT '播放数量'")
    private int playnum;

    /**
     * 评论数量
     */
    @ApiModelProperty(value = "评论数量",position = 16,example = "100")
    @Column(name = "commentnum",columnDefinition = "int DEFAULT 0 COMMENT '评论数量'")
    private int commentnum;

    /**
     * 点赞数量
     */
    @ApiModelProperty(value = "点赞数量",position = 16,example = "100")
    @Column(name = "agreenum",columnDefinition = "int DEFAULT 0 COMMENT '点赞数量'")
    private int agreenum;

    /**
     * 收藏数量
     */
    @ApiModelProperty(value = "收藏数量",position = 16,example = "100")
    @Column(name = "collectionnum",columnDefinition = "int DEFAULT 0 COMMENT '收藏数量'")
    private int collectionnum;

    /**
     * 发布时间
     */
    @ApiModelProperty(value = "发布时间",position = 16,example = "2024-01-01 00:00:00")
    @Column(name = "publish_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publish_time=new Date();

    /**
     * 预览地址
     */
    @ApiModelProperty(value = "预览地址",position = 16,example = "")
    @Column(name = "preview_url")
    private String  preview_url;

    /**
     * 作者id
     */
    @ApiModelProperty(value = "作者id",position = 16,example = "0")
    @Column(name = "userid",length = 100)
    private String  userid;

    /**
     * 视频路径
     */
    @ApiModelProperty(value = "视频路径",position = 16,example = "http://xx.com/1.mp4")
    @Column()
    private String videopath;

    /**
     * 视频贴图主图
     */
    @ApiModelProperty(value = "视频贴图主图",position = 16,example = "http://xx.com/1.png")
    @Column()
    private String videomainimag;

    /**
     * 创建日期
     */
    @ApiModelProperty(value = "创建日期",position = 16,example = "2024-01-01 00:00:00")
    @CreatedDate
    @Column()
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ctime;

    @ApiModelProperty(value = "校验码",position = 16,example = "aabbccdd")
    @Column(name = "verifycode")
    private String  verifycode;


}
